package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.UserAddressMapper;
import com.qj.yantaishan.domain.UserAddress;
import com.qj.yantaishan.service.IUserAddressService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 收货地址Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class UserAddressServiceImpl    extends ServiceImpl<UserAddressMapper, UserAddress>  implements IUserAddressService
{
    @Autowired
    private UserAddressMapper userAddressMapper;

    /**
     * 查询收货地址
     * 
     * @param addressId 收货地址主键
     * @return 收货地址
     */
    @Override
    public UserAddress selectUserAddressByAddressId(Integer addressId)
    {
        return userAddressMapper.selectUserAddressByAddressId(addressId);
    }

    /**
     * 查询收货地址列表
     * 
     * @param userAddress 收货地址
     * @return 收货地址
     */
    @Override
    public List<UserAddress> selectUserAddressList(UserAddress userAddress)
    {
        return userAddressMapper.selectUserAddressList(userAddress);
    }

    /**
     * 新增收货地址
     * 
     * @param userAddress 收货地址
     * @return 结果
     */
    @Override
    public int insertUserAddress(UserAddress userAddress)
    {
        return userAddressMapper.insertUserAddress(userAddress);
    }

    /**
     * 修改收货地址
     * 
     * @param userAddress 收货地址
     * @return 结果
     */
    @Override
    public int updateUserAddress(UserAddress userAddress)
    {
        return userAddressMapper.updateUserAddress(userAddress);
    }

    /**
     * 批量删除收货地址
     * 
     * @param addressIds 需要删除的收货地址主键
     * @return 结果
     */
    @Override
    public int deleteUserAddressByAddressIds(String addressIds)
    {
        return userAddressMapper.deleteUserAddressByAddressIds(Convert.toStrArray(addressIds));
    }

    /**
     * 删除收货地址信息
     * 
     * @param addressId 收货地址主键
     * @return 结果
     */
    @Override
    public int deleteUserAddressByAddressId(Integer addressId)
    {
        return userAddressMapper.deleteUserAddressByAddressId(addressId);
    }
}
